var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');
var logger = require('morgan');
var cors = require('cors');

var ljbRouter = require('./routes/ljb');
var lxkRouter = require('./routes/lxk');
var lzxRouter = require('./routes/lzx');
var xlRouter = require('./routes/xl');
var zjqRouter = require('./routes/zjq');
var menuRouter = require('./routes/menu');


var app = express();
app.use(cors());
app.use(logger('dev'));
app.use(express.json());
app.use('/upload', express.static(path.join(__dirname, 'upload')));

app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));

app.use('/ljb', ljbRouter);
app.use('/lxk', lxkRouter);
app.use('/lzx', lzxRouter);
app.use('/xl', xlRouter);
app.use('/zjq', zjqRouter);
app.use('/menu', menuRouter);

module.exports = app;
